package com.amado.course36ByteStream;

import java.io.File;

public class PrintFile {
	public static void main(String[] args) {
		File directory = new File("F:/抽奖活动需求");
		File[] files = directory.listFiles();
		printDirectory(files,0);
	}

	public static void printDirectory(File[] direcotoryArray,int i) {
		for (File file : direcotoryArray) {
			if (file.isDirectory()) {
				printI(i);
				System.out.println(file.getName());
				printDirectory(file.listFiles(),i+1);
			} else {
				printI(i);
				System.out.println(file.getName());
			}
		}
	}
	
	public static void printI(int i) {
		for (int j=0;j<i;j++) {
			System.out.print("\t");
		}
	}
}
